home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3c / getinvent.z / getinvent
Encoding:
Text File  |  2002-10-03  |  6.2 KB  |  133 lines

  1.  
  2.  
  3.  
  4. GGGGEEEETTTTIIIINNNNVVVVEEEENNNNTTTT((((3333))))                                                      GGGGEEEETTTTIIIINNNNVVVVEEEENNNNTTTT((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      getinvent, setinvent, endinvent, scaninvent, getinvent_r, setinvent_r,
  10.      endinvent_r - get hardware inventory entry
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<iiiinnnnvvvveeeennnntttt....hhhh>>>>
  14.  
  15.      iiiinnnnvvvveeeennnnttttoooorrrryyyy____tttt ****ggggeeeettttiiiinnnnvvvveeeennnntttt ((((vvvvooooiiiidddd))));;;;
  16.  
  17.      iiiinnnntttt sssseeeettttiiiinnnnvvvveeeennnntttt ((((vvvvooooiiiidddd))));;;;
  18.  
  19.      vvvvooooiiiidddd eeeennnnddddiiiinnnnvvvveeeennnntttt ((((vvvvooooiiiidddd))));;;;
  20.  
  21.      iiiinnnnvvvveeeennnnttttoooorrrryyyy____tttt ****ggggeeeettttiiiinnnnvvvveeeennnntttt____rrrr ((((iiiinnnnvvvv____ssssttttaaaatttteeee____tttt ****sssstttt))));;;;
  22.  
  23.      iiiinnnntttt sssseeeettttiiiinnnnvvvveeeennnntttt____rrrr ((((iiiinnnnvvvv____ssssttttaaaatttteeee____tttt ********sssstttt))));;;;
  24.  
  25.      vvvvooooiiiidddd eeeennnnddddiiiinnnnvvvveeeennnntttt____rrrr ((((iiiinnnnvvvv____ssssttttaaaatttteeee____tttt ****sssstttt))));;;;
  26.  
  27.      iiiinnnntttt ssssccccaaaannnniiiinnnnvvvveeeennnntttt ((((iiiinnnntttt ((((****))))((((iiiinnnnvvvveeeennnnttttoooorrrryyyy____tttt ****,,,, vvvvooooiiiidddd ****)))),,,, vvvvooooiiiidddd ****))));;;;
  28.  
  29.      iiiinnnntttt ____kkkkeeeeeeeeppppiiiinnnnvvvveeeennnntttt;;;;
  30.  
  31. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  32.      _g_e_t_i_n_v_e_n_t returns a pointer to an object with the following structure
  33.      containing an entry from the system hardware inventory table.  Each entry
  34.      in the table contains an ``inventory'' structure, declared in the
  35.      <_s_y_s/_i_n_v_e_n_t._h> header file:
  36.  
  37.           typedef struct inventory_s {
  38.                struct inventory_s *inv_next;
  39.                int  inv_class;
  40.                int  inv_type;
  41.                char inv_controller;
  42.                char inv_unit;
  43.                long inv_state;
  44.           } inventory_t;
  45.  
  46.  
  47.      Each inventory entry is described by a _c_l_a_s_s and a class-specific _t_y_p_e.
  48.      The remaining fields provide further information on the inventory entry.
  49.      See the comments in the header file for an explanation of these fields.
  50.      The <_i_n_v_e_n_t._h> header file includes <_s_y_s/_i_n_v_e_n_t._h>, and should be
  51.      included before calling inventory functions.
  52.  
  53.      _g_e_t_i_n_v_e_n_t when first called returns a pointer to the first inventory
  54.      structure in the table; thereafter, it returns a pointer to the next
  55.      inventory structure in the table; so successive calls can be used to
  56.      search the entire table.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. GGGGEEEETTTTIIIINNNNVVVVEEEENNNNTTTT((((3333))))                                                      GGGGEEEETTTTIIIINNNNVVVVEEEENNNNTTTT((((3333))))
  71.  
  72.  
  73.  
  74.      A call to _s_e_t_i_n_v_e_n_t has the effect of rewinding the table to allow
  75.      repeated searches.  It should always be called before calling _g_e_t_i_n_v_e_n_t.
  76.      _e_n_d_i_n_v_e_n_t may be called to free allocated storage when processing is
  77.      complete.
  78.  
  79.      A reentrant version of these functions also exists.  These should be used
  80.      in multi-threaded applications where the shared data implicit in the
  81.      functions described above is inappropriate.  The reentrant version
  82.      requires that a state structure _i_n_v__s_t_a_t_e__t be initialized via
  83.      _s_e_t_i_n_v_e_n_t__r and passed to _g_e_t_i_n_v_e_n_t__r and _e_n_d_i_n_v_e_n_t__r.  The first time
  84.      _s_e_t_i_n_v_e_n_t__r is called, its parameter should be the address of a pointer
  85.      initialized to _NNNN_UUUU_LLLL_LLLL.  Subsequent calls to _s_e_t_i_n_v_e_n_t__r with the
  86.      initialized pointer have the effect of rewinding the table to allow
  87.      repeated searches.  This structure holds a pointer to the data and the
  88.      current location in the data, and therefore permits multiple threads to
  89.      call the functions simultaneously with no possibility of losing data.
  90.  
  91.      _s_c_a_n_i_n_v_e_n_t applies fun to each inventory entry, passing the entry's
  92.      address and arg to fun.  If fun returns a non-zero value, _s_c_a_n_i_n_v_e_n_t
  93.      stops scanning and returns that value.  Otherwise _s_c_a_n_i_n_v_e_n_t returns 0
  94.      after scanning all entries.  _s_c_a_n_i_n_v_e_n_t normally calls _e_n_d_i_n_v_e_n_t before
  95.      returning.  To prevent this call, set __k_e_e_p_i_n_v_e_n_t to a non-zero value.
  96.  
  97. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  98.      _g_e_t_i_n_v_e_n_t and _g_e_t_i_n_v_e_n_t__r return a NNNNUUUULLLLLLLL pointer when they have read all
  99.      entries.  _s_e_t_i_n_v_e_n_t and _s_e_t_i_n_v_e_n_t__r return -1 on failure.  _s_c_a_n_i_n_v_e_n_t
  100.      returns -1 if it cannot successfully _s_e_t_i_n_v_e_n_t or _s_e_t_i_n_v_e_n_t__r before
  101.      scanning.
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.